feat(jcache): [Cache Tracing 5] Add SentryJCacheWrapper for JCache (JSR-107)#5179
Open
adinauer wants to merge 10 commits intofeat/cache-tracing-samplefrom
Open
feat(jcache): [Cache Tracing 5] Add SentryJCacheWrapper for JCache (JSR-107)#5179adinauer wants to merge 10 commits intofeat/cache-tracing-samplefrom
adinauer wants to merge 10 commits intofeat/cache-tracing-samplefrom
Conversation
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Core
Spring
Other
Bug Fixes 🐛
🤖 This preview updates automatically when you update the PR. |
Contributor
|
This was referenced Mar 9, 2026
Sentry Build Distribution
|
Contributor
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0ceb700 | 305.81 ms | 355.91 ms | 50.10 ms |
| 855766f | 364.82 ms | 427.16 ms | 62.35 ms |
| eeb463c | 311.36 ms | 371.79 ms | 60.43 ms |
| b2b863f | 338.62 ms | 376.54 ms | 37.92 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 0ceb700 | 0 B | 0 B | 0 B |
| 855766f | 0 B | 0 B | 0 B |
| eeb463c | 0 B | 0 B | 0 B |
| b2b863f | 0 B | 0 B | 0 B |
Previous results on branch: feat/cache-tracing-jcache
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| bff862e | 315.13 ms | 364.41 ms | 49.28 ms |
| 10c6fa4 | 308.73 ms | 384.38 ms | 75.66 ms |
| 290c35b | 320.64 ms | 355.09 ms | 34.45 ms |
| c3caf85 | 313.96 ms | 352.98 ms | 39.02 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| bff862e | 0 B | 0 B | 0 B |
| 10c6fa4 | 0 B | 0 B | 0 B |
| 290c35b | 0 B | 0 B | 0 B |
| c3caf85 | 0 B | 0 B | 0 B |
Like putIfAbsent, these are conditional writes that may be no-ops. Emitting a cache.put span for them would be misleading.
Sentry Build Distribution
|
startChild can return a NoOp span (e.g. when span limit is reached). Skip instrumentation in that case to avoid unnecessary work.
Sentry Build Distribution
|
removeAll() with no args removes all entries, which is semantically equivalent to clear(). Use cache.flush instead of cache.remove. The keyed removeAll(Set) remains cache.remove.
Sentry Build Distribution
|
8 tasks
Sentry Build Distribution
|
Sentry Build Distribution
|
Sentry Build Distribution
|
8 tasks
Member
Author
|
cursor review |
Member
Author
|
@sentry review |
1 similar comment
Member
Author
|
@sentry review |
Member
Author
|
cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Sentry Build Distribution
|
This was referenced Mar 10, 2026
Draft
lbloder
reviewed
Mar 16, 2026
| - [Apache Ignite](https://ignite.apache.org/) | ||
| - [Infinispan](https://infinispan.org/) | ||
|
|
||
| Please consult the documentation on how to install and use this integration in the Sentry Docs for [Java](https://docs.sentry.io/platforms/java/tracing/instrumentation/jcache/). |
Collaborator
There was a problem hiding this comment.
Is this going to be the final url for the jcache docs? We need to make sure to update this if needed
Member
Author
There was a problem hiding this comment.
Let's confirm before merging the PR
lbloder
approved these changes
Mar 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Stack (Cache Tracing)
📜 Description
Adds a new
sentry-jcachemodule that provides cache tracing for apps using the JCache (JSR-107) API.SentryJCacheWrapper<K,V>implementsjavax.cache.Cache<K,V>and creates Sentry spans for cache operations:cache.get—get,getAll,invoke,invokeAllcache.put—put,getAndPut,putAll,replace,getAndReplacecache.remove—remove,getAndRemove,removeAllcache.flush—clearputIfAbsent,containsKey,close,loadAll, metadata methods, listener registration,iteratorSets
cache.hit,cache.keyspan attributes viaSpanDataConvention. Gated onisEnableCacheTracing(). Trace origin:auto.cache.jcache.💡 Motivation and Context
Spring Cache covers Spring users, but many Java apps use JCache directly (plain Java, Micronaut, CDI/Jakarta EE). This module provides the same cache tracing experience for those users. JCache never migrated to Jakarta namespace, so
javax.cacheworks everywhere.💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
sentry-spring-jakartaandsentry-spring